package com.glsc.ngateway.common.base.domain.mysql.opmanage.report.basicsettings;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDateTime;

@Entity
@Table(name = "t_asset_pool")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class AssetPool {
    @Id
    @Column(name="fl_assetpoolid")
    private Long assetPoolId;

    @Column(name="fc_assetpoolname")
    private String assetPoolName;

    @Column(name="fl_valid")
    private Long valid;

    @Column(name="fc_modifier")
    private String modifier;

    @Column(name = "fd_modifytime")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime modifyTime;

    @Column(name="fc_remark")
    private String remark;

    @Column(name="fc_system")
    private String system;

//    @OneToOne
//    @JoinColumn(name = "fl_modifier", referencedColumnName = "id", insertable = false, updatable = false)
//    private User userByUserId;

    public Long getAssetPoolId() {
        return assetPoolId;
    }

    public void setAssetPoolId(Long assetPoolId) {
        this.assetPoolId = assetPoolId;
    }

    public String getAssetPoolName() {
        return assetPoolName;
    }

    public void setAssetPoolName(String assetPoolName) {
        this.assetPoolName = assetPoolName;
    }

    public void setValid(Long valid) {
        this.valid = valid;
    }

    public Long getValid() {
        return valid;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier;
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifyTime(LocalDateTime modifyTime) {
        this.modifyTime = modifyTime;
    }

    public LocalDateTime getModifyTime() {
        return modifyTime;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRemark() {
        return remark;
    }

    public String getSystem() {
        return system;
    }

    public void setSystem(String system) {
        this.system = system;
    }

    //    public User getUserByUserId() {
//        return userByUserId;
//    }
//
//    public void setUserByUserId(User userByUserId) {
//        this.userByUserId = userByUserId;
//    }

//    @Override
//    public String toString(){
//        return "AssetPool{" +
//                "assetPoolId=" + assetPoolId +
//                ", assetPoolName='" + assetPoolName + '\'' +
//                ", valid=" + valid +
//                ", modifier=" + modifier +
//                ", modifyTime='" + modifyTime + '\'' +
//                ", remark='" + remark + '\'' +
//                ", userName='" + userByUserId + '\'' +
//                '}';
//    }
}
